package com.witmore.neutron.ai.web.websocket.impl;

import com.witmore.neutron.ai.web.websocket.WebSocketServer;
import com.witmore.neutron.ai.web.websocket.WebSocketService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.io.IOException;

/**
 * WebSocket服务实现类
 * Author: 豆子高
 * Date: 2025/12/19
 */
@Slf4j
@Service
public class WebSocketServiceImpl implements WebSocketService {

    @Override
    public void sendMessageToScene(String sceneId, String message) {
        try {
            WebSocketServer.sendInfo(message, sceneId);
        } catch (IOException e) {
            log.error("发送WebSocket消息失败，sceneId：{}，message：{}", sceneId, message, e);
        }
    }

}
